import { HttpRequest } from '@/shared/http/commonAxios'

export class ArticeApi {
	/**
	 * 创建文章
	 */
	static createArticle(data) {
		return HttpRequest.post('/article/create', data)
	}

	/**
	 * 文章查询
	 */
	static queryArticel(data) {
		return HttpRequest.get('/article/query', data)
	}

	/**
	 * 删除文章
	 */
	static deleteAtricle(data) {
		return HttpRequest.post('/article/delete', data)
	}

	/**
	 * 更新文章
	 */
	static updata(data) {
		return HttpRequest.post('/article/update', data)
	}
	/**
	 * 更具文章id获取文章详情
	 */
	static queryArticleDetails(data) {
		return HttpRequest.get('/article/queryArticleDetails', data)
	}

	/**
	 * 批量删除文章
	 */
	static batchDel(data) {
		return HttpRequest.post('/article/batchDelete', data)
	}

	/**
	 * 获取分类
	 */
	static getType() {
		return HttpRequest.get('/typeManage/queryAll')
	}

	/**
	 * 发布文章
	 */
	static publish(data) {
		return HttpRequest.post('/article/publish', data)
	}

	/**
	 * 图片上传
	 */
	static upload(data) {
		return HttpRequest.post('/upload-file/image', data)
	}

	/**
	 * 获取归档文章
	 */
	static getGroupedArticle() {
		return HttpRequest.get('/article/grouped')
	}
}
